package com.xfhy.selectcity.data;

import com.xfhy.selectcity.App;

import java.util.List;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;

/**
 * @author : xfhy
 * Create time : 2021/2/25 13:22
 * Description :
 */
public class AreaViewModel extends ViewModel {

    private AreaRepository mAreaRepository;

    public AreaViewModel() {
        mAreaRepository = new AreaRepository(App.sContext);
    }

    public LiveData<List<Area>> getAllWords() {
        return mAreaRepository.getAllAreas();
    }

    public LiveData<List<String>> queryCitiesByProvince(String province) {
        return mAreaRepository.queryCitiesByProvince(province);
    }

    public LiveData<List<Area>> queryAreasByCity(String city) {
        return mAreaRepository.queryAreasByCity(city);
    }

    public LiveData<List<String>> queryAllProvinceName() {
        return mAreaRepository.queryAllProvinceName();
    }

}

